<!--
  ~ Electronic Logistics Management Information System (eLMIS) is a supply chain management system for health commodities in a developing country setting.
  ~
  ~ Copyright (C) 2015  John Snow, Inc (JSI). This program was produced for the U.S. Agency for International Development (USAID). It was prepared under the USAID | DELIVER PROJECT, Task Order 4.
  ~
  ~ This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
  ~
  ~ This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Affero General Public License for more details.
  ~
  ~ You should have received a copy of the GNU Affero General Public License along with this program.  If not, see <http://www.gnu.org/licenses/>.
  -->

<div>
  <div ng-show="!disease.id">

    <h2><span openlmis-message="header.track.disease"></span> : <span openlmis-message="label.disease.add.new"></span></h2>
  </div>

  <div ng-show="disease.id">
    <h2><span openlmis-message="header.track.disease"></span> : <span openlmis-message="label.disease.edit"></span></h2>
  </div>

  <form id="diseaseForm" name="diseaseForm" novalidate>

    <div class="app-form" id="diseaseFormDetail">

      <div>
        <div class="form-row clearfix row-fluid">
          <div class="span4">
            <div class="form-cell">
              <label id="diseaseName">
                <span openlmis-message="label.disease.name"></span>
                <span class="label-required"> *</span>
              </label>

              <div class="form-field">
                <input ng-model="disease.name" name="name" id="name" type="text" maxlength="200"
                       ng-required="true"/>
              <span class="field-error" ng-show="!disease.name && showError"
                    openlmis-message="missing.value"></span>
              </div>
            </div>
          </div>
        </div>

        <div class="form-row clearfix row-fluid">
          <div class="span4">
            <div class="form-cell">
              <label id="diseaseDescription">
                <span openlmis-message="label.disease.description"></span>
                <span class="label-required"> *</span>
              </label>

              <div class="form-field">
                <textarea ng-model="disease.description" name="name" id="description" maxlength="200"
                       ng-required="true"></textarea>
              <span class="field-error" ng-show="!disease.description && showError"
                    openlmis-message="missing.value"></span>
              </div>
            </div>
          </div>
        </div>

        <div class="form-row clearfix row-fluid">
          <div class="span4">
            <div class="form-cell">
              <label>
                <span openlmis-message="label.disease.display.order"></span>
                <span class="label-required"> *</span>
              </label>

              <div class="form-field">
                <input ng-model="disease.displayOrder" name="displayOrder" id="displayOrder" type="number"
                       ng-required="true"/>
              <span class="field-error" ng-show="!disease.name && showError"
                    openlmis-message="missing.value"></span>
              </div>
            </div>
          </div>
        </div>

      </div>
    </div>
  </form>

  <div form-toolbar id="action_buttons" class="action-buttons">
    <div class="form-cell button-row">
      <input id="saveButton" type="submit" id="save-button" class="btn btn-primary save-button" ng-click="save(diseaseForm)"
             openlmis-message="button.save"/>
      <a id="cancelButton" href="#/disease" type="button" class="btn btn-cancel cancel-button" ><span openlmis-message="button.cancel"></span></a>
    </div>

    <div class="toolbar-error" id="saveErrorMsgDiv">
      <span openlmis-message="error" ng-show="error"></span>&nbsp;
      <span ng-show="errorProgram" ng-bind="errorProgram"></span>
    </div>
    <div class="toolbar-success" id="saveSuccessMsgDiv" openlmis-message="message" ng-show="message"></div>
  </div>

</div>